<?php

namespace App\Logging;

class AddRequestId
{
    public function __invoke($logger)
    {
        foreach ($logger->getHandlers() as $handler) {
            $handler->pushProcessor(function ($record) {
                $record['extra']['request_id'] = REQUEST_ID;
                return $record;
            });
        }

    }
}